using UnityEngine;

namespace BuildingSystem.Scripts
{
    public static class Utils 
    {
        public static bool InRange(int value, int startInclusive, int endExclusive) =>
            startInclusive <= value && value < endExclusive;
        public static bool InRange(float value, float startInclusive, float endExclusive, float error = .001f) =>
            (startInclusive < value + error) && (value - error < endExclusive);

        public static bool IsInt(float value) =>
            (value * 2) % 2 == 0;

        public static Vector2Int ToVector2Int(Vector2 vector) =>
            new Vector2Int((int)vector.x, (int)vector.y); 
    }
}